home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / bgft211.zip / BGFTUITL.SLT < prev    next >
Text File  |  1991-05-02  |  6KB  |  117 lines

  1. // BGFTUITL.SLT: Telix script for BGFT Xmodem-1K upload.
  2. // Support Package for Registered Users of BGFT (TM).
  3. // Copyright 1990-1991 Dirac Systems.
  4. // Telix is a trademark of Exis Inc.
  5.  
  6. // Operation of this script is made a little complicated due to
  7. //      the different ways that Telix and BGFT do uploads. To satisfy
  8. //      BGFT's needs, the file to be uploaded must be in the file buffer.
  9. //      This is best done by moving files with BGFT.EXE; but it can also
  10. //      be done with BGFTOPT /m<filename> if desired. Also, to satisfy
  11. //      Telix, the same named file must be in its default upload directory.
  12. //      Telix must be able to open the file before it calls this script to
  13. //      make sure it exists in its upload directory; if Telix cannot find
  14. //      the file it will announce 'No Matching File(s)'. Telix will not
  15. //      actually do anything with the file it opens for upload,
  16. //      as BGFT will send the file in the file buffer.
  17.  
  18. // MANUAL INSTALLATION:
  19. // The following outlines how to install the script for use as an
  20. //      external protocol in Telix:
  21. // Be sure that the resident part (BGFT360K.COM or BGFT720K.COM) of
  22. //      BGFT is loaded before the communications program. Add /B if
  23. //      you want Drive B:. The BGFT status window does not need to be
  24. //      active; it need only be resident.
  25. // The batch file BGFTINIT.BAT is used to initialize BGFT prior to
  26. //      running Telix. This file must be edited to contain information
  27. //      about your modem's port number and baud rate prior to use
  28. //      (default is 1200 baud, port 1). You must run the batch file
  29. //      BGFTINIT.BAT to make sure that BGFT is set up properly. THIS
  30. //      MUST BE DONE before using BGFT as an external protocol under
  31. //      Telix. This is true even though the baud and port are set here.
  32. // Put the right sized floppy (.720, 1.2, or 1.44 Megabyte DOS
  33. //      formatted, no errors for BGFT720K.COM ; the above or 360K DOS
  34. //      formatted, no errors for BGFT360K.COM) into the desired floppy
  35. //      drive. The floppy size must correspond to the drive type.
  36. // Compile the BGFTUITL.SLT by using the Telix compiler, CS, viz.
  37. //      CS BGFTUITL
  38. //      This will produce BGFTUITL.SLC for use in Telix.
  39. // From terminal mode do 'Alt_O' for 'Configure Telix'.
  40. // Choose 'Protocol Options'.
  41. // 'Change which setting?': Choose one of the four external protocol
  42. //      options: A, B, C, or D.
  43. // Key: When in the upload operation, pressing this key will choose
  44. //      the protocol. The key should not be used elsewhere, eg. X (Xmodem).
  45. //      Choose 'I', for example. It will be highlighted for the Telix
  46. //      upload operation.
  47. // Protocol name: This is what will show up in the list of protocols when
  48. //      you choose the upload operation. Call it, 'BGFTImdm'.
  49. // Upload file name: Enter, BGFTUITL. This will be the compiled script.
  50. // Download file name: You could use the file BGFTDXTL.SLT since it will
  51. //      receive the -1K as well as the CRC Xmodem.
  52. // BAT or Script: Choose 'Script' since BGFTUITL.SLT is a script.
  53. // DL name: Choose 'Y' for yes since you want Telix to pass the name of the
  54. //      file to the script. The script will get rid of Telix's upload
  55. //      directory since BGFT only wants to put the filename on the floppy.
  56. // ESC out of the screen and save the set up to disk by hitting 'W'. This
  57. //      get you back into Telix terminal mode.
  58. // Upload as you normally would (PgUp); tell the host to send via Xmodem-1K.
  59. // Choose the BGFTImdm protocol using arrows plus an ENTER or by the Key
  60. //      defined above.
  61. // The script will give some messages, start the background transfer, and
  62. //      exit Telix. You will be at the DOS prompt.
  63. // You should see the BGFT window indicate normal transmission.
  64. // Now you can do your work in foreground as the file is uploaded in
  65. //      background.
  66. // After completion you can use BGFT.EXE to move your files to some DOS
  67. //      directory. The files are ready to use.
  68. // Use BGFTOPT /3<Pathname> to dump downloaded files from the file buffer
  69. //      to a specified directory.
  70. //
  71.  
  72.  
  73. str command[80];                // Command string for BGFTOPT.
  74. str temp[80];                   // Temporary concatenation string.
  75. int updirlen;                   // Telix upload drive:directory str length.
  76. int extfilelen;                 // Telix external file maximum str length.
  77.  
  78. // The command we will issue to DOS is:
  79. //              BGFTOPT /q /a /r# /b# /~4 /uFn /s
  80. //    where:
  81. //      /q    - quiet mode (don't printout results)
  82. //      /a    - acknowledge any error that may be present
  83. //      /r#    - select port # (eg. /r1)
  84. //        /b#   - select baud # (eg. /b2400)
  85. //        /~4   - select protocol 4: Xmodem-1K upload
  86. //        /uFn  - set upload filename Fn (eg test.tst)
  87. //      /s    - start the transfer
  88.  
  89. main()
  90. {
  91. command = "/q";                         // Start command line.
  92. strcat(command," /a");                  // Acknowledge any error.
  93. strcat(command," /r");
  94. itos(get_port(),temp);                  // Find out where we are connected.
  95. strcat(command,temp);                   // Reconnect existing comm port.
  96. strcat(command," /b");
  97. itos(get_baud(),temp);                  // Find out what is the baud rate.
  98. strcat(command,temp);                   // Set baud rate for resident.
  99. //
  100. //      BGFT requires a filename from Telix.
  101. //
  102. strcat(command," /u");                  // Set up upload.
  103. updirlen = strlen(_up_dir);             // Get unwanted Telix upld directory.
  104. extfilelen = strmaxlen(_ext_filespec);  // Get maximum length of Telix file.
  105. substr(_ext_filespec,updirlen,extfilelen,temp);    // Shave off upld dir.
  106. strcat(command,temp);                   // Put BGFT filename in '/u' command.
  107. //
  108. //      Xmodem-1K Upload
  109. //
  110. strcat(command," /~4");                 // This protocol is Xmodem-1K upload.
  111. strcat(command," /s");                  // Start to send file.
  112. prints(command);                        // Tell user the command string.
  113. run("bgftopt.exe",command,2);
  114. exittelix(0,0);                         // Leave Telix; don't hangup line.
  115. }                                       // Now enjoy background Xmodem-1K upld.
  116.  
  117.